<?php
namespace data\service;
use data\model\DaysignModel;

class DaysignService extends BaseService {

    private $daySignModel = null;

    public function __construct() {
        parent::__construct();
        $this->daySignModel = new DaysignModel();
    }

    public function addDaySign( $score , $uid , $daytime){
        $retVal = $this->daySignModel->save(['uid'=>$uid,'score'=>$score,'ctime'=>time(),'daytime' => $daytime ]);
        if( $retVal ){
            return $retVal;
        }
        return 0;
    }
    public function getDaySign($uid,$dayTime){
        $res = $this->daySignModel->getInfo([ 'uid' => $uid , 'daytime' => $dayTime ] , "id,uid,score");
        return empty($res) ? [] : $res;

    }

}
